Pretty simple, uses net user, should disable UAC but I can't be bothered atm.






#include <iostream.h> // Used for input/output
#include <windows.h> // Used for string manipulation and system
#include <conio.h> // Used for getch()

void changePass(char[20]); // Define changePass function, take one parameter.

// main function.
int main(){
   char userName[20]; // Define userName - holds 19 characters
   cout << "Please enter username: "; // Ask for userName
   cin >> userName; // Recieve userName
   changePass(userName); // Call function, provide userName
   
   getch(); // Wait for user input before exiting.
   return 0;
}

// changePass function, takes one parameter.
void changePass(char userName[20]){
   char command[30]; // Define command - 29 characters
   
   strcpy(command, "net user "); // Assign "net user " to command
   strcat(command, userName); // Add "userName" to command
   strcat(command, " *"); // Add " *" to command

   system(command); // Call command

   cout << userName << " Password Was Successfully Changed" << endl; // Little message
}